<?php
require_once( 'mafachi.Content.php' );
require_once( 'mafachi.ArticleData.php' );
class Article extends Content {
	protected static $tableID = 'article_id';
	protected static $ContentDataType = 'ArticleData';
	protected static $ContentType = 'Article';

	public function __construct() {
		$this->contentData = new ArticleData();
		$this->is_loaded = false;
	}
	public function add() {
		if( !$this->source || !$this->content || !$this->title ) {
			return false;
		}	
		if ( !get_magic_quotes_gpc() ) {
			$this->source = addslashes( $this->source );
			$this->writer = addslashes( $this->writer );
			$this->title = addslashes( $this->title );
			$this->content = addslashes( $this->content );
		}
		$this->contentData->add();
		return true;
	}
	public function update() {
		if( !$this->source || !$this->content || !$this->title ) {
			return false;
		}	
		if ( !get_magic_quotes_gpc() ) {
			$this->source = addslashes( $this->source );
			$this->writer = addslashes( $this->writer );
			$this->title = addslashes( $this->title );
			$this->content = addslashes( $this->content );
		}
		$this->contentData->update();
		return true;
	}
}
?>